<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: QCPAbstractItem Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#signals">Signals</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="class_q_c_p_abstract_item-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QCPAbstractItem Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>The abstract base class for all items in a plot.  
 <a href="class_q_c_p_abstract_item.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for QCPAbstractItem:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_q_c_p_abstract_item.png" usemap="#QCPAbstractItem_map" alt=""/>
  <map id="QCPAbstractItem_map" name="QCPAbstractItem_map">
<area href="class_q_c_p_layerable.html" title="Base class for all drawable objects. " alt="QCPLayerable" shape="rect" coords="0,56,128,80"/>
<area href="class_q_c_p_item_bracket.html" title="A bracket for referencing/highlighting certain parts in the plot. " alt="QCPItemBracket" shape="rect" coords="138,168,266,192"/>
<area href="class_q_c_p_item_curve.html" title="A curved line from one point to another. " alt="QCPItemCurve" shape="rect" coords="138,224,266,248"/>
<area href="class_q_c_p_item_ellipse.html" title="An ellipse. " alt="QCPItemEllipse" shape="rect" coords="138,280,266,304"/>
<area href="class_q_c_p_item_line.html" title="A line from one point to another. " alt="QCPItemLine" shape="rect" coords="138,336,266,360"/>
<area href="class_q_c_p_item_pixmap.html" title="An arbitrary pixmap. " alt="QCPItemPixmap" shape="rect" coords="138,392,266,416"/>
<area href="class_q_c_p_item_rect.html" title="A rectangle. " alt="QCPItemRect" shape="rect" coords="138,448,266,472"/>
<area href="class_q_c_p_item_straight_line.html" title="A straight line that spans infinitely in both directions. " alt="QCPItemStraightLine" shape="rect" coords="138,504,266,528"/>
<area href="class_q_c_p_item_text.html" title="A text label. " alt="QCPItemText" shape="rect" coords="138,560,266,584"/>
<area href="class_q_c_p_item_tracer.html" title="Item that sticks to QCPGraph data points. " alt="QCPItemTracer" shape="rect" coords="138,616,266,640"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
Signals</h2></td></tr>
<tr class="memitem:aa5cffb034fc65dbb91c77e02c1c14251"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#aa5cffb034fc65dbb91c77e02c1c14251">selectionChanged</a> (bool selected)</td></tr>
<tr class="separator:aa5cffb034fc65dbb91c77e02c1c14251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b266c11aac61cb511901f3911dac2a3"><td class="memItemLeft" align="right" valign="top"><a id="a5b266c11aac61cb511901f3911dac2a3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>selectableChanged</b> (bool selectable)</td></tr>
<tr class="separator:a5b266c11aac61cb511901f3911dac2a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header signals_class_q_c_p_layerable"><td colspan="2" onclick="javascript:toggleInherit('signals_class_q_c_p_layerable')"><img src="closed.png" alt="-"/>&#160;Signals inherited from <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a></td></tr>
<tr class="memitem:abbf8657cedea73ac1c3499b521c90eba inherit signals_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#abbf8657cedea73ac1c3499b521c90eba">layerChanged</a> (<a class="el" href="class_q_c_p_layer.html">QCPLayer</a> *newLayer)</td></tr>
<tr class="separator:abbf8657cedea73ac1c3499b521c90eba inherit signals_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9922507d8b4503a1fe1ed0b1030e23b6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a9922507d8b4503a1fe1ed0b1030e23b6">QCPAbstractItem</a> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot)</td></tr>
<tr class="separator:a9922507d8b4503a1fe1ed0b1030e23b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42715ad5f3d7fca6854025fa5636f436"><td class="memItemLeft" align="right" valign="top"><a id="a42715ad5f3d7fca6854025fa5636f436"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>clipToAxisRect</b> () const</td></tr>
<tr class="separator:a42715ad5f3d7fca6854025fa5636f436"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae162314efd3fe1a6d4df11da1d275d52"><td class="memItemLeft" align="right" valign="top"><a id="ae162314efd3fe1a6d4df11da1d275d52"></a>
<a class="el" href="class_q_c_p_axis_rect.html">QCPAxisRect</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>clipAxisRect</b> () const</td></tr>
<tr class="separator:ae162314efd3fe1a6d4df11da1d275d52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae29aa489767352b40c4aaa7ea50c5582"><td class="memItemLeft" align="right" valign="top"><a id="ae29aa489767352b40c4aaa7ea50c5582"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>selectable</b> () const</td></tr>
<tr class="separator:ae29aa489767352b40c4aaa7ea50c5582"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa069fba320a13639f119f82ad29ead96"><td class="memItemLeft" align="right" valign="top"><a id="aa069fba320a13639f119f82ad29ead96"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>selected</b> () const</td></tr>
<tr class="separator:aa069fba320a13639f119f82ad29ead96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39e05b9d4176b9accafc746d16ca6a06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a39e05b9d4176b9accafc746d16ca6a06">setClipToAxisRect</a> (bool clip)</td></tr>
<tr class="separator:a39e05b9d4176b9accafc746d16ca6a06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dc75fcbcd10206fe0b75d757ea7a347"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a7dc75fcbcd10206fe0b75d757ea7a347">setClipAxisRect</a> (<a class="el" href="class_q_c_p_axis_rect.html">QCPAxisRect</a> *rect)</td></tr>
<tr class="separator:a7dc75fcbcd10206fe0b75d757ea7a347"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a8e32a55bc478b849756a78c2d87fd2"><td class="memItemLeft" align="right" valign="top">Q_SLOT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a8a8e32a55bc478b849756a78c2d87fd2">setSelectable</a> (bool selectable)</td></tr>
<tr class="separator:a8a8e32a55bc478b849756a78c2d87fd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a203de94ad586cc44d16c9565f49d3378"><td class="memItemLeft" align="right" valign="top">Q_SLOT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a203de94ad586cc44d16c9565f49d3378">setSelected</a> (bool selected)</td></tr>
<tr class="separator:a203de94ad586cc44d16c9565f49d3378"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96d522d10ffc0413b9a366c6f7f0476b"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a96d522d10ffc0413b9a366c6f7f0476b">selectTest</a> (const QPointF &amp;pos, bool onlySelectable, QVariant *details=0) const =0</td></tr>
<tr class="separator:a96d522d10ffc0413b9a366c6f7f0476b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a709f655ac3f7f22d452714134662b454"><td class="memItemLeft" align="right" valign="top">QList&lt; <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a709f655ac3f7f22d452714134662b454">positions</a> () const</td></tr>
<tr class="separator:a709f655ac3f7f22d452714134662b454"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81d1ecfea3368b836cf9675a0045e659"><td class="memItemLeft" align="right" valign="top">QList&lt; <a class="el" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a81d1ecfea3368b836cf9675a0045e659">anchors</a> () const</td></tr>
<tr class="separator:a81d1ecfea3368b836cf9675a0045e659"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2589c3d298f9a576d77d9addb440a18d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a2589c3d298f9a576d77d9addb440a18d">position</a> (const QString &amp;name) const</td></tr>
<tr class="separator:a2589c3d298f9a576d77d9addb440a18d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a139c255ea8831642fac91748e29a5adb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a139c255ea8831642fac91748e29a5adb">anchor</a> (const QString &amp;name) const</td></tr>
<tr class="separator:a139c255ea8831642fac91748e29a5adb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84914f4516f9b38ef0bd89eafe3dbda7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_abstract_item.html#a84914f4516f9b38ef0bd89eafe3dbda7">hasAnchor</a> (const QString &amp;name) const</td></tr>
<tr class="separator:a84914f4516f9b38ef0bd89eafe3dbda7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_q_c_p_layerable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_q_c_p_layerable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a></td></tr>
<tr class="memitem:a74c0fa237f29bf0e49565013fc5d1ec0 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#a74c0fa237f29bf0e49565013fc5d1ec0">QCPLayerable</a> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *plot, QString targetLayer=QString(), <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> *<a class="el" href="class_q_c_p_layerable.html#aa78b7e644d2c519e1a9a6f2ac5fcd858">parentLayerable</a>=0)</td></tr>
<tr class="separator:a74c0fa237f29bf0e49565013fc5d1ec0 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0297b944b6192b6d67d00bff41b6b70 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="af0297b944b6192b6d67d00bff41b6b70"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>visible</b> () const</td></tr>
<tr class="separator:af0297b944b6192b6d67d00bff41b6b70 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a473edb813a4c1929d6b6a8fe3ff3faf7 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a473edb813a4c1929d6b6a8fe3ff3faf7"></a>
<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>parentPlot</b> () const</td></tr>
<tr class="separator:a473edb813a4c1929d6b6a8fe3ff3faf7 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa78b7e644d2c519e1a9a6f2ac5fcd858 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#aa78b7e644d2c519e1a9a6f2ac5fcd858">parentLayerable</a> () const</td></tr>
<tr class="separator:aa78b7e644d2c519e1a9a6f2ac5fcd858 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ff4862e8c784c9f5986dbc1533ba2a4 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a5ff4862e8c784c9f5986dbc1533ba2a4"></a>
<a class="el" href="class_q_c_p_layer.html">QCPLayer</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>layer</b> () const</td></tr>
<tr class="separator:a5ff4862e8c784c9f5986dbc1533ba2a4 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71cbd212fde2703cee076e204a475709 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a71cbd212fde2703cee076e204a475709"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>antialiased</b> () const</td></tr>
<tr class="separator:a71cbd212fde2703cee076e204a475709 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bed99ddc396b48ce3ebfdc0418744f8 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#a3bed99ddc396b48ce3ebfdc0418744f8">setVisible</a> (bool on)</td></tr>
<tr class="separator:a3bed99ddc396b48ce3ebfdc0418744f8 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0d0da6d2de45a118886d2c8e16d5a54 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">Q_SLOT bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#ab0d0da6d2de45a118886d2c8e16d5a54">setLayer</a> (<a class="el" href="class_q_c_p_layer.html">QCPLayer</a> *layer)</td></tr>
<tr class="separator:ab0d0da6d2de45a118886d2c8e16d5a54 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab25a0e7b897993b44447caee0f142083 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#ab25a0e7b897993b44447caee0f142083">setLayer</a> (const QString &amp;layerName)</td></tr>
<tr class="separator:ab25a0e7b897993b44447caee0f142083 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fd43e89be4a553ead41652565ff0581 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#a4fd43e89be4a553ead41652565ff0581">setAntialiased</a> (bool enabled)</td></tr>
<tr class="separator:a4fd43e89be4a553ead41652565ff0581 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab054e88f15d485defcb95e7376f119e7 inherit pub_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_layerable.html#ab054e88f15d485defcb95e7376f119e7">realVisibility</a> () const</td></tr>
<tr class="separator:ab054e88f15d485defcb95e7376f119e7 inherit pub_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a59279d8123663b3b2fffbe54ca075244"><td class="memItemLeft" align="right" valign="top"><a id="a59279d8123663b3b2fffbe54ca075244"></a>
virtual <a class="el" href="namespace_q_c_p.html#a2ad6bb6281c7c2d593d4277b44c2b037">QCP::Interaction</a>&#160;</td><td class="memItemRight" valign="bottom"><b>selectionCategory</b> () const</td></tr>
<tr class="separator:a59279d8123663b3b2fffbe54ca075244"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a550ecff39195d9ff3d5cf239eb802ea7"><td class="memItemLeft" align="right" valign="top"><a id="a550ecff39195d9ff3d5cf239eb802ea7"></a>
virtual QRect&#160;</td><td class="memItemRight" valign="bottom"><b>clipRect</b> () const</td></tr>
<tr class="separator:a550ecff39195d9ff3d5cf239eb802ea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82a408b38a93be750b934fe847a018cb"><td class="memItemLeft" align="right" valign="top"><a id="a82a408b38a93be750b934fe847a018cb"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>applyDefaultAntialiasingHint</b> (<a class="el" href="class_q_c_p_painter.html">QCPPainter</a> *painter) const</td></tr>
<tr class="separator:a82a408b38a93be750b934fe847a018cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0dc056f650c3ca73414e6b4f01674ef"><td class="memItemLeft" align="right" valign="top"><a id="ad0dc056f650c3ca73414e6b4f01674ef"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>draw</b> (<a class="el" href="class_q_c_p_painter.html">QCPPainter</a> *painter)=0</td></tr>
<tr class="separator:ad0dc056f650c3ca73414e6b4f01674ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf92af7b9893712959a6c073d334d88d"><td class="memItemLeft" align="right" valign="top"><a id="aaf92af7b9893712959a6c073d334d88d"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>selectEvent</b> (QMouseEvent *event, bool additive, const QVariant &amp;details, bool *selectionStateChanged)</td></tr>
<tr class="separator:aaf92af7b9893712959a6c073d334d88d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91f090d6763cfedb0749219c63788ae9"><td class="memItemLeft" align="right" valign="top"><a id="a91f090d6763cfedb0749219c63788ae9"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>deselectEvent</b> (bool *selectionStateChanged)</td></tr>
<tr class="separator:a91f090d6763cfedb0749219c63788ae9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5681c190803e899bac9a240753fdba00"><td class="memItemLeft" align="right" valign="top"><a id="a5681c190803e899bac9a240753fdba00"></a>
virtual QPointF&#160;</td><td class="memItemRight" valign="bottom"><b>anchorPixelPoint</b> (int anchorId) const</td></tr>
<tr class="separator:a5681c190803e899bac9a240753fdba00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f4d23e883cbb55219959ed6ce8f10ac"><td class="memItemLeft" align="right" valign="top"><a id="a8f4d23e883cbb55219959ed6ce8f10ac"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>distSqrToLine</b> (const QPointF &amp;start, const QPointF &amp;end, const QPointF &amp;point) const</td></tr>
<tr class="separator:a8f4d23e883cbb55219959ed6ce8f10ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26aa3828d398e29116afee16216d6b36"><td class="memItemLeft" align="right" valign="top"><a id="a26aa3828d398e29116afee16216d6b36"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>rectSelectTest</b> (const QRectF &amp;rect, const QPointF &amp;pos, bool filledRect) const</td></tr>
<tr class="separator:a26aa3828d398e29116afee16216d6b36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75036d39c4d4e2e1a7dd145fff915d32"><td class="memItemLeft" align="right" valign="top"><a id="a75036d39c4d4e2e1a7dd145fff915d32"></a>
<a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>createPosition</b> (const QString &amp;name)</td></tr>
<tr class="separator:a75036d39c4d4e2e1a7dd145fff915d32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3fc92527802078ca395138748b629a7"><td class="memItemLeft" align="right" valign="top"><a id="af3fc92527802078ca395138748b629a7"></a>
<a class="el" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>createAnchor</b> (const QString &amp;name, int anchorId)</td></tr>
<tr class="separator:af3fc92527802078ca395138748b629a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_methods_class_q_c_p_layerable"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_class_q_c_p_layerable')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a></td></tr>
<tr class="memitem:ab20b7dbd8e0249ed61adb9622c427382 inherit pro_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="ab20b7dbd8e0249ed61adb9622c427382"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>parentPlotInitialized</b> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot)</td></tr>
<tr class="separator:ab20b7dbd8e0249ed61adb9622c427382 inherit pro_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cbe5a0c9a5674249982f5ca5f8e02bc inherit pro_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a8cbe5a0c9a5674249982f5ca5f8e02bc"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>initializeParentPlot</b> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot)</td></tr>
<tr class="separator:a8cbe5a0c9a5674249982f5ca5f8e02bc inherit pro_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa23c893671f1f6744ac235cf2204cf3a inherit pro_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="aa23c893671f1f6744ac235cf2204cf3a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>setParentLayerable</b> (<a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> *<a class="el" href="class_q_c_p_layerable.html#aa78b7e644d2c519e1a9a6f2ac5fcd858">parentLayerable</a>)</td></tr>
<tr class="separator:aa23c893671f1f6744ac235cf2204cf3a inherit pro_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af94484cfb7cbbddb7de522e9be71d9a4 inherit pro_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="af94484cfb7cbbddb7de522e9be71d9a4"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>moveToLayer</b> (<a class="el" href="class_q_c_p_layer.html">QCPLayer</a> *layer, bool prepend)</td></tr>
<tr class="separator:af94484cfb7cbbddb7de522e9be71d9a4 inherit pro_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb663e375d2d36dc5c55021ee5a2119b inherit pro_methods_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="acb663e375d2d36dc5c55021ee5a2119b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>applyAntialiasingHint</b> (<a class="el" href="class_q_c_p_painter.html">QCPPainter</a> *painter, bool localAntialiased, <a class="el" href="namespace_q_c_p.html#ae55dbe315d41fe80f29ba88100843a0c">QCP::AntialiasedElement</a> overrideElement) const</td></tr>
<tr class="separator:acb663e375d2d36dc5c55021ee5a2119b inherit pro_methods_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ad2a70ff6b658fcb84a9427f69d3f587d"><td class="memItemLeft" align="right" valign="top"><a id="ad2a70ff6b658fcb84a9427f69d3f587d"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mClipToAxisRect</b></td></tr>
<tr class="separator:ad2a70ff6b658fcb84a9427f69d3f587d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e57cfe7da4b1ac3d6fa7281ea437361"><td class="memItemLeft" align="right" valign="top"><a id="a3e57cfe7da4b1ac3d6fa7281ea437361"></a>
QPointer&lt; <a class="el" href="class_q_c_p_axis_rect.html">QCPAxisRect</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mClipAxisRect</b></td></tr>
<tr class="separator:a3e57cfe7da4b1ac3d6fa7281ea437361"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af94ff71b6a15ea6d028ab8bd8eccd012"><td class="memItemLeft" align="right" valign="top"><a id="af94ff71b6a15ea6d028ab8bd8eccd012"></a>
QList&lt; <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mPositions</b></td></tr>
<tr class="separator:af94ff71b6a15ea6d028ab8bd8eccd012"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a909a3abab783de302ebf0a0e6f2bbc15"><td class="memItemLeft" align="right" valign="top"><a id="a909a3abab783de302ebf0a0e6f2bbc15"></a>
QList&lt; <a class="el" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mAnchors</b></td></tr>
<tr class="separator:a909a3abab783de302ebf0a0e6f2bbc15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad81eb35c8726a0f458db9df9732e0e41"><td class="memItemLeft" align="right" valign="top"><a id="ad81eb35c8726a0f458db9df9732e0e41"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mSelectable</b></td></tr>
<tr class="separator:ad81eb35c8726a0f458db9df9732e0e41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bdb3457dad1d268c0f78a44152b9645"><td class="memItemLeft" align="right" valign="top"><a id="a4bdb3457dad1d268c0f78a44152b9645"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mSelected</b></td></tr>
<tr class="separator:a4bdb3457dad1d268c0f78a44152b9645"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_class_q_c_p_layerable"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_q_c_p_layerable')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a></td></tr>
<tr class="memitem:a62e3aed8427d6ce3ccf716f285106cb3 inherit pro_attribs_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a62e3aed8427d6ce3ccf716f285106cb3"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mVisible</b></td></tr>
<tr class="separator:a62e3aed8427d6ce3ccf716f285106cb3 inherit pro_attribs_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2a528433e44db02b8aef23c1f9f90ed inherit pro_attribs_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="aa2a528433e44db02b8aef23c1f9f90ed"></a>
<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>mParentPlot</b></td></tr>
<tr class="separator:aa2a528433e44db02b8aef23c1f9f90ed inherit pro_attribs_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3291445a980053e2d17a21d15957624e inherit pro_attribs_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a3291445a980053e2d17a21d15957624e"></a>
QPointer&lt; <a class="el" href="class_q_c_p_layerable.html">QCPLayerable</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mParentLayerable</b></td></tr>
<tr class="separator:a3291445a980053e2d17a21d15957624e inherit pro_attribs_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa38ec5891aff0f50b36fd63e9372a0cd inherit pro_attribs_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="aa38ec5891aff0f50b36fd63e9372a0cd"></a>
<a class="el" href="class_q_c_p_layer.html">QCPLayer</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>mLayer</b></td></tr>
<tr class="separator:aa38ec5891aff0f50b36fd63e9372a0cd inherit pro_attribs_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ab45a4c76a3333ce42eb217a81733ec inherit pro_attribs_class_q_c_p_layerable"><td class="memItemLeft" align="right" valign="top"><a id="a3ab45a4c76a3333ce42eb217a81733ec"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mAntialiased</b></td></tr>
<tr class="separator:a3ab45a4c76a3333ce42eb217a81733ec inherit pro_attribs_class_q_c_p_layerable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a1cdf9df76adcfae45261690aa0ca2198"><td class="memItemLeft" align="right" valign="top"><a id="a1cdf9df76adcfae45261690aa0ca2198"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>QCustomPlot</b></td></tr>
<tr class="separator:a1cdf9df76adcfae45261690aa0ca2198"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61767d414fd57af9eb1741b34268c7fc"><td class="memItemLeft" align="right" valign="top"><a id="a61767d414fd57af9eb1741b34268c7fc"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>QCPItemAnchor</b></td></tr>
<tr class="separator:a61767d414fd57af9eb1741b34268c7fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The abstract base class for all items in a plot. </p>
<p>In <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a>, items are supplemental graphical elements that are neither plottables (<a class="el" href="class_q_c_p_abstract_plottable.html" title="The abstract base class for all data representing objects in a plot. ">QCPAbstractPlottable</a>) nor axes (<a class="el" href="class_q_c_p_axis.html" title="Manages a single axis inside a QCustomPlot. ">QCPAxis</a>). While plottables are always tied to two axes and thus plot coordinates, items can also be placed in absolute coordinates independent of any axes. Each specific item has at least one <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> member which controls the positioning. Some items are defined by more than one coordinate and thus have two or more <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> members (For example, <a class="el" href="class_q_c_p_item_rect.html" title="A rectangle. ">QCPItemRect</a> has <em>topLeft</em> and <em>bottomRight</em>).</p>
<p>This abstract base class defines a very basic interface like visibility and clipping. Since this class is abstract, it can't be instantiated. Use one of the subclasses or create a subclass yourself to create new items.</p>
<p>The built-in items are: </p><table class="doxtable">
<tr>
<td><a class="el" href="class_q_c_p_item_line.html" title="A line from one point to another. ">QCPItemLine</a></td><td>A line defined by a start and an end point. May have different ending styles on each side (e.g. arrows). </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_straight_line.html" title="A straight line that spans infinitely in both directions. ">QCPItemStraightLine</a></td><td>A straight line defined by a start and a direction point. Unlike <a class="el" href="class_q_c_p_item_line.html" title="A line from one point to another. ">QCPItemLine</a>, the straight line is infinitely long and has no endings. </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_curve.html" title="A curved line from one point to another. ">QCPItemCurve</a></td><td>A curve defined by start, end and two intermediate control points. May have different ending styles on each side (e.g. arrows). </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_rect.html" title="A rectangle. ">QCPItemRect</a></td><td>A rectangle </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_ellipse.html" title="An ellipse. ">QCPItemEllipse</a></td><td>An ellipse </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_pixmap.html" title="An arbitrary pixmap. ">QCPItemPixmap</a></td><td>An arbitrary pixmap </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_text.html" title="A text label. ">QCPItemText</a></td><td>A text label </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_bracket.html" title="A bracket for referencing/highlighting certain parts in the plot. ">QCPItemBracket</a></td><td>A bracket which may be used to reference/highlight certain parts in the plot. </td></tr>
<tr>
<td><a class="el" href="class_q_c_p_item_tracer.html" title="Item that sticks to QCPGraph data points. ">QCPItemTracer</a></td><td>An item that can be attached to a <a class="el" href="class_q_c_p_graph.html" title="A plottable representing a graph in a plot. ">QCPGraph</a> and sticks to its data points, given a key coordinate. </td></tr>
</table>
<h1><a class="anchor" id="items-clipping"></a>
Clipping</h1>
<p>Items are by default clipped to the main axis rect (they are only visible inside the axis rect). To make an item visible outside that axis rect, disable clipping via <a class="el" href="class_q_c_p_abstract_item.html#a39e05b9d4176b9accafc746d16ca6a06">setClipToAxisRect(false)</a>.</p>
<p>On the other hand if you want the item to be clipped to a different axis rect, specify it via <a class="el" href="class_q_c_p_abstract_item.html#a7dc75fcbcd10206fe0b75d757ea7a347">setClipAxisRect</a>. This clipAxisRect property of an item is only used for clipping behaviour, and in principle is independent of the coordinate axes the item might be tied to via its position members (<a class="el" href="class_q_c_p_item_position.html#a2185f45c75ac8cb9be89daeaaad50e37">QCPItemPosition::setAxes</a>). However, it is common that the axis rect for clipping also contains the axes used for the item positions.</p>
<h1><a class="anchor" id="items-using"></a>
Using items</h1>
<p>First you instantiate the item you want to use and add it to the plot: </p><div class="fragment"></div><!-- fragment --><p>by default, the positions of the item are bound to the x- and y-Axis of the plot. So we can just set the plot coordinates where the line should start/end: </p><div class="fragment"></div><!-- fragment --><p>If we don't want the line to be positioned in plot coordinates but a different coordinate system, e.g. absolute pixel positions on the <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> surface, we need to change the position type like this: </p><div class="fragment"></div><!-- fragment --><p>Then we can set the coordinates, this time in pixels: </p><div class="fragment"></div><!-- fragment --><p>and make the line visible on the entire <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a>, by disabling clipping to the axis rect: </p><div class="fragment"></div><!-- fragment --><p> For more advanced plots, it is even possible to set different types and parent anchors per X/Y coordinate of an item position, using for example <a class="el" href="class_q_c_p_item_position.html#a2113b2351d6d00457fb3559a4e20c3ea">QCPItemPosition::setTypeX</a> or <a class="el" href="class_q_c_p_item_position.html#add71461a973927c74e42179480916d9c">QCPItemPosition::setParentAnchorX</a>. For details, see the documentation of <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a>.</p>
<h1><a class="anchor" id="items-subclassing"></a>
Creating own items</h1>
<p>To create an own item, you implement a subclass of <a class="el" href="class_q_c_p_abstract_item.html" title="The abstract base class for all items in a plot. ">QCPAbstractItem</a>. These are the pure virtual functions, you must implement: </p><ul>
<li><a class="el" href="class_q_c_p_abstract_item.html#a96d522d10ffc0413b9a366c6f7f0476b">selectTest</a> </li>
<li>draw</li>
</ul>
<p>See the documentation of those functions for what they need to do.</p>
<h2><a class="anchor" id="items-positioning"></a>
Allowing the item to be positioned</h2>
<p>As mentioned, item positions are represented by <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> members. Let's assume the new item shall have only one point as its position (as opposed to two like a rect or multiple like a polygon). You then add a public member of type <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> like so:</p>
<div class="fragment"><div class="line"><a class="code" href="class_q_c_p_item_position.html">QCPItemPosition</a> * <span class="keyword">const</span> myPosition;</div></div><!-- fragment --><p>the const makes sure the pointer itself can't be modified from the user of your new item (the <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> instance it points to, can be modified, of course). The initialization of this pointer is made easy with the createPosition function. Just assign the return value of this function to each <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> in the constructor of your item. createPosition takes a string which is the name of the position, typically this is identical to the variable name. For example, the constructor of QCPItemExample could look like this:</p>
<div class="fragment"><div class="line">QCPItemExample::QCPItemExample(<a class="code" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot) :</div><div class="line">  <a class="code" href="class_q_c_p_abstract_item.html">QCPAbstractItem</a>(parentPlot),</div><div class="line">  myPosition(createPosition(<span class="stringliteral">&quot;myPosition&quot;</span>))</div><div class="line">{</div><div class="line">  <span class="comment">// other constructor code</span></div><div class="line">}</div></div><!-- fragment --><h2><a class="anchor" id="items-drawing"></a>
The draw function</h2>
<p>To give your item a visual representation, reimplement the draw function and use the passed <a class="el" href="class_q_c_p_painter.html" title="QPainter subclass used internally. ">QCPPainter</a> to draw the item. You can retrieve the item position in pixel coordinates from the position member(s) via <a class="el" href="class_q_c_p_item_position.html#a6cad070c22801295231f5bd6045afe70">QCPItemPosition::pixelPoint</a>.</p>
<p>To optimize performance you should calculate a bounding rect first (don't forget to take the pen width into account), check whether it intersects the clipRect, and only draw the item at all if this is the case.</p>
<h2><a class="anchor" id="items-selection"></a>
The selectTest function</h2>
<p>Your implementation of the <a class="el" href="class_q_c_p_abstract_item.html#a96d522d10ffc0413b9a366c6f7f0476b">selectTest</a> function may use the helpers distSqrToLine and rectSelectTest. With these, the implementation of the selection test becomes significantly simpler for most items. See the documentation of <a class="el" href="class_q_c_p_abstract_item.html#a96d522d10ffc0413b9a366c6f7f0476b">selectTest</a> for what the function parameters mean and what the function should return.</p>
<h2><a class="anchor" id="anchors"></a>
Providing anchors</h2>
<p>Providing anchors (<a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a>) starts off like adding a position. First you create a public member, e.g.</p>
<div class="fragment"><div class="line"><a class="code" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> * <span class="keyword">const</span> bottom;</div></div><!-- fragment --><p>and create it in the constructor with the createAnchor function, assigning it a name and an anchor id (an integer enumerating all anchors on the item, you may create an own enum for this). Since anchors can be placed anywhere, relative to the item's position(s), your item needs to provide the position of every anchor with the reimplementation of the anchorPixelPoint(int anchorId) function.</p>
<p>In essence the <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a> is merely an intermediary that itself asks your item for the pixel position when anything attached to the anchor needs to know the coordinates. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a9922507d8b4503a1fe1ed0b1030e23b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9922507d8b4503a1fe1ed0b1030e23b6">&#9670;&nbsp;</a></span>QCPAbstractItem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPAbstractItem::QCPAbstractItem </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td>
          <td class="paramname"><em>parentPlot</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Base class constructor which initializes base class members. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a139c255ea8831642fac91748e29a5adb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a139c255ea8831642fac91748e29a5adb">&#9670;&nbsp;</a></span>anchor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> * QCPAbstractItem::anchor </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a> with the specified <em>name</em>. If this item doesn't have an anchor by that name, returns 0.</p>
<p>This function provides an alternative way to access item anchors. Normally, you access anchors direcly by their member pointers (which typically have the same variable name as <em>name</em>).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a81d1ecfea3368b836cf9675a0045e659">anchors</a>, <a class="el" href="class_q_c_p_abstract_item.html#a2589c3d298f9a576d77d9addb440a18d">position</a> </dd></dl>

</div>
</div>
<a id="a81d1ecfea3368b836cf9675a0045e659"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81d1ecfea3368b836cf9675a0045e659">&#9670;&nbsp;</a></span>anchors()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QList&lt; <a class="el" href="class_q_c_p_item_anchor.html">QCPItemAnchor</a> * &gt; QCPAbstractItem::anchors </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns all anchors of the item in a list. Note that since a position (<a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a>) is always also an anchor, the list will also contain the positions of this item.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a709f655ac3f7f22d452714134662b454">positions</a>, <a class="el" href="class_q_c_p_abstract_item.html#a139c255ea8831642fac91748e29a5adb">anchor</a> </dd></dl>

</div>
</div>
<a id="a84914f4516f9b38ef0bd89eafe3dbda7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84914f4516f9b38ef0bd89eafe3dbda7">&#9670;&nbsp;</a></span>hasAnchor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool QCPAbstractItem::hasAnchor </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns whether this item has an anchor with the specified <em>name</em>.</p>
<p>Note that you can check for positions with this function, too. This is because every position is also an anchor (<a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> inherits from <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a>).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a139c255ea8831642fac91748e29a5adb">anchor</a>, <a class="el" href="class_q_c_p_abstract_item.html#a2589c3d298f9a576d77d9addb440a18d">position</a> </dd></dl>

</div>
</div>
<a id="a2589c3d298f9a576d77d9addb440a18d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2589c3d298f9a576d77d9addb440a18d">&#9670;&nbsp;</a></span>position()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * QCPAbstractItem::position </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> with the specified <em>name</em>. If this item doesn't have a position by that name, returns 0.</p>
<p>This function provides an alternative way to access item positions. Normally, you access positions direcly by their member pointers (which typically have the same variable name as <em>name</em>).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a709f655ac3f7f22d452714134662b454">positions</a>, <a class="el" href="class_q_c_p_abstract_item.html#a139c255ea8831642fac91748e29a5adb">anchor</a> </dd></dl>

</div>
</div>
<a id="a709f655ac3f7f22d452714134662b454"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a709f655ac3f7f22d452714134662b454">&#9670;&nbsp;</a></span>positions()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QList&lt; <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * &gt; QCPAbstractItem::positions </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns all positions of the item in a list.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a81d1ecfea3368b836cf9675a0045e659">anchors</a>, <a class="el" href="class_q_c_p_abstract_item.html#a2589c3d298f9a576d77d9addb440a18d">position</a> </dd></dl>

</div>
</div>
<a id="aa5cffb034fc65dbb91c77e02c1c14251"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5cffb034fc65dbb91c77e02c1c14251">&#9670;&nbsp;</a></span>selectionChanged</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPAbstractItem::selectionChanged </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>selected</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">signal</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This signal is emitted when the selection state of this item has changed, either by user interaction or by a direct call to <a class="el" href="class_q_c_p_abstract_item.html#a203de94ad586cc44d16c9565f49d3378">setSelected</a>. </p>

</div>
</div>
<a id="a96d522d10ffc0413b9a366c6f7f0476b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a96d522d10ffc0413b9a366c6f7f0476b">&#9670;&nbsp;</a></span>selectTest()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual double QCPAbstractItem::selectTest </td>
          <td>(</td>
          <td class="paramtype">const QPointF &amp;&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>onlySelectable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QVariant *&#160;</td>
          <td class="paramname"><em>details</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This function is used to decide whether a click hits a layerable object or not.</p>
<p><em>pos</em> is a point in pixel coordinates on the <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn't be determined, -1.0 is returned. Further, if <em>onlySelectable</em> is true and the object is not selectable, -1.0 is returned, too.</p>
<p>If the object is represented not by single lines but by an area like a <a class="el" href="class_q_c_p_item_text.html">QCPItemText</a> or the bars of a <a class="el" href="class_q_c_p_bars.html">QCPBars</a> plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot's selection tolerance. (typically the selectionTolerance multiplied by 0.99).</p>
<p>Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.e. closer than 0.99*selectionTolerance).</p>
<p>The actual setting of the selection state is not done by this function. This is handled by the parent <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> when the mouseReleaseEvent occurs, and the finally selected object is notified via the selectEvent/deselectEvent methods.</p>
<p><em>details</em> is an optional output parameter. Every layerable subclass may place any information in <em>details</em>. This information will be passed to selectEvent when the parent <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> decides on the basis of this selectTest call, that the object was successfully selected. The subsequent call to selectEvent will carry the <em>details</em>. This is useful for multi-part objects (like <a class="el" href="class_q_c_p_axis.html" title="Manages a single axis inside a QCustomPlot. ">QCPAxis</a>). This way, a possibly complex calculation to decide which part was clicked is only done once in <a class="el" href="class_q_c_p_abstract_item.html#a96d522d10ffc0413b9a366c6f7f0476b">selectTest</a>. The result (i.e. the actually clicked part) can then be placed in <em>details</em>. So in the subsequent selectEvent, the decision which part was selected doesn't have to be done a second time for a single selection operation.</p>
<p>You may pass 0 as <em>details</em> to indicate that you are not interested in those selection details.</p>
<dl class="section see"><dt>See also</dt><dd>selectEvent, deselectEvent, <a class="el" href="class_q_custom_plot.html#a5ee1e2f6ae27419deca53e75907c27e5">QCustomPlot::setInteractions</a> </dd></dl>

<p>Reimplemented from <a class="el" href="class_q_c_p_layerable.html#a04db8351fefd44cfdb77958e75c6288e">QCPLayerable</a>.</p>

<p>Implemented in <a class="el" href="class_q_c_p_item_bracket.html#a971299aa6fef75730d6f10efdaf48616">QCPItemBracket</a>, <a class="el" href="class_q_c_p_item_tracer.html#ae1dc728384936184e7552a6d0d67fd75">QCPItemTracer</a>, <a class="el" href="class_q_c_p_item_pixmap.html#a7583a98ebd3f35d2ac5d6c05fad25a6c">QCPItemPixmap</a>, <a class="el" href="class_q_c_p_item_ellipse.html#aa41be2180b2ace2e303b88d005c14243">QCPItemEllipse</a>, <a class="el" href="class_q_c_p_item_text.html#aca74494fd5e769f331a6eb3e29f32916">QCPItemText</a>, <a class="el" href="class_q_c_p_item_rect.html#abe1a6091591d3bad5e4efab2331f99ec">QCPItemRect</a>, <a class="el" href="class_q_c_p_item_curve.html#a8018b8b3fc552a44ba87ca4b64c1523f">QCPItemCurve</a>, <a class="el" href="class_q_c_p_item_line.html#ae6cc5183f568e5fa9d7827abe4d405b5">QCPItemLine</a>, and <a class="el" href="class_q_c_p_item_straight_line.html#a1e5d99d79efb5871600c72bcd2891a0f">QCPItemStraightLine</a>.</p>

</div>
</div>
<a id="a7dc75fcbcd10206fe0b75d757ea7a347"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7dc75fcbcd10206fe0b75d757ea7a347">&#9670;&nbsp;</a></span>setClipAxisRect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPAbstractItem::setClipAxisRect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_c_p_axis_rect.html">QCPAxisRect</a> *&#160;</td>
          <td class="paramname"><em>rect</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the clip axis rect. It defines the rect that will be used to clip the item when <a class="el" href="class_q_c_p_abstract_item.html#a39e05b9d4176b9accafc746d16ca6a06">setClipToAxisRect</a> is set to true.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a39e05b9d4176b9accafc746d16ca6a06">setClipToAxisRect</a> </dd></dl>

</div>
</div>
<a id="a39e05b9d4176b9accafc746d16ca6a06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39e05b9d4176b9accafc746d16ca6a06">&#9670;&nbsp;</a></span>setClipToAxisRect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPAbstractItem::setClipToAxisRect </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>clip</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether the item shall be clipped to an axis rect or whether it shall be visible on the entire <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a>. The axis rect can be set with <a class="el" href="class_q_c_p_abstract_item.html#a7dc75fcbcd10206fe0b75d757ea7a347">setClipAxisRect</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a7dc75fcbcd10206fe0b75d757ea7a347">setClipAxisRect</a> </dd></dl>

</div>
</div>
<a id="a8a8e32a55bc478b849756a78c2d87fd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a8e32a55bc478b849756a78c2d87fd2">&#9670;&nbsp;</a></span>setSelectable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPAbstractItem::setSelectable </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>selectable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether the user can (de-)select this item by clicking on the <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> surface. (When <a class="el" href="class_q_custom_plot.html#a5ee1e2f6ae27419deca53e75907c27e5">QCustomPlot::setInteractions</a> contains QCustomPlot::iSelectItems.)</p>
<p>However, even when <em>selectable</em> was set to false, it is possible to set the selection manually, by calling <a class="el" href="class_q_c_p_abstract_item.html#a203de94ad586cc44d16c9565f49d3378">setSelected</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_custom_plot.html#a5ee1e2f6ae27419deca53e75907c27e5">QCustomPlot::setInteractions</a>, <a class="el" href="class_q_c_p_abstract_item.html#a203de94ad586cc44d16c9565f49d3378">setSelected</a> </dd></dl>

</div>
</div>
<a id="a203de94ad586cc44d16c9565f49d3378"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a203de94ad586cc44d16c9565f49d3378">&#9670;&nbsp;</a></span>setSelected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPAbstractItem::setSelected </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>selected</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether this item is selected or not. When selected, it might use a different visual appearance (e.g. pen and brush), this depends on the specific item though.</p>
<p>The entire selection mechanism for items is handled automatically when <a class="el" href="class_q_custom_plot.html#a5ee1e2f6ae27419deca53e75907c27e5">QCustomPlot::setInteractions</a> contains QCustomPlot::iSelectItems. You only need to call this function when you wish to change the selection state manually.</p>
<p>This function can change the selection state even when <a class="el" href="class_q_c_p_abstract_item.html#a8a8e32a55bc478b849756a78c2d87fd2">setSelectable</a> was set to false.</p>
<p>emits the <a class="el" href="class_q_c_p_abstract_item.html#aa5cffb034fc65dbb91c77e02c1c14251">selectionChanged</a> signal when <em>selected</em> is different from the previous selection state.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_abstract_item.html#a8a8e32a55bc478b849756a78c2d87fd2">setSelectable</a>, <a class="el" href="class_q_c_p_abstract_item.html#a96d522d10ffc0413b9a366c6f7f0476b">selectTest</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8h_source.html">qcustomplot.h</a></li>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8cpp.html">qcustomplot.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
